package com.hq.fxh.No5_User.MyModle.Activity.item;

import android.content.Context;
import android.text.TextUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.hq.fxh.No5_User.MyModle.AdBannerInfo;
import com.hq.fxh.R;
import com.hq.fxh.Utils.GlideUtils;


/**
 * Created by Lenovo on 2016/11/26.
 */
public class BigAdContentItem extends LinearLayout {
    /**
     * 贴片广告
     */
    private ImageView pic;

    public BigAdContentItem(Context context) {
        super(context);
        inflate(context, R.layout.item_big_ad_content, this);
        initView();
    }

    private void initView() {
        pic = (ImageView) findViewById(R.id.pic);
    }

    /**
     * @param adInfo
     */
    public void showAdInfo(final AdBannerInfo adInfo) {
        if (adInfo != null) {
            final AdBannerInfo.AdvertDetailBean adBean = adInfo.getAdvert_detail();
            if (adBean != null) {
                String url = adBean.getPic();
                if (!TextUtils.isEmpty(url)) {
//                    GlideUtils.loadRoundedImage(getContext(),url,getContext().getResources().getDimensionPixelSize(R.dimen.size_6),pic);
                    GlideUtils.loadImage(getContext(), url, pic);
                }
            }
        }
    }
}
